Expose mesh vertex count in SoftBody3D#110331
Open
LordDeatHunter wants to merge 1 commit intogodotengine:masterfrom
Open
Expose mesh vertex count in SoftBody3D#110331LordDeatHunter wants to merge 1 commit intogodotengine:masterfrom
LordDeatHunter wants to merge 1 commit intogodotengine:masterfrom
Conversation
bcff724 to
74dd435
Compare
74dd435 to
616ec40
Compare
565eefc to
81d84ca
Compare
jrouwe
requested changes
Feb 21, 2026
81d84ca to
8407b03
Compare
mihe
requested changes
Feb 22, 2026
Contributor
mihe
left a comment
There was a problem hiding this comment.
A couple of notes:
- You should ideally make an accompanying proposal when adding new stuff, even if it's just exposing existing data like this, so as to motivate why you need it. You mentioned why you want the point count, but why you need the AABB was less obvious. We need to make sure we're solving whatever root problem you might be having.
PhysicsServer3D.soft_body_get_point_countdoes not need to be exposed. It will never be any different from the size of the index buffer of the mesh you've assigned to yourSoftBody3D. See the discussion in godotengine/godot-proposals#13335 for more details. There might still be some argument for keepingSoftBody3D.get_point_count()though, to simply return a cached value of the index buffer size.- Since
SoftBody3Dinherits fromVisualInstance3D, it already has a virtualget_aabb()method that should be used instead of adding a newget_bounds()method. This could in fact be framed as a bug even, since the editor won't currently show the correct bounds when you select aSoftBody3Dusing the "3D" input mode in the embedded game view, but will if you implementget_aabb()instead.
(Also, calling the physics server getters directly, like what so many of the methods in SoftBody3D do, is quite problematic for threading reasons as well, but that's beyond the scope of this PR I guess.)
Author
|
8407b03 to
700cce1
Compare
jrouwe
approved these changes
Mar 14, 2026
Contributor
jrouwe
left a comment
There was a problem hiding this comment.
Since it is apparently easy to overlook that you can query the mesh for the number of vertices in the soft body, an obvious function that gives you the number seems useful to me.
mihe
requested changes
Mar 27, 2026
700cce1 to
39ecb08
Compare
39ecb08 to
59b825a
Compare
mihe
requested changes
Apr 28, 2026
59b825a to
353d960
Compare
mihe
approved these changes
Apr 29, 2026
Contributor
mihe
left a comment
There was a problem hiding this comment.
Seems to work well, and looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed that a lot of SoftBody3D's functionalities are not exposed in the editor.
With this PR, I exposed the already existing bounding box, as well as creating and exposing a separate method for the vertex (point) count.
With the existing point-related methods, you have to specify an index, but as far as I'm aware, there is no way of knowing if the provided index is valid (in bounds) other than running the game and checking for an error: